package com.jtlrm.ckd.mvp.view.adapter;

import android.widget.ImageView;

import com.base.sdk.util.DateFormatUtil;
import com.base.sdk.util.ImageUtil;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.jtlrm.ckd.R;
import com.jtlrm.ckd.entity.HuanZheInfoEntity;

public class HuanZheGuanLiAdapter extends BaseQuickAdapter<HuanZheInfoEntity, BaseViewHolder> {
    public HuanZheGuanLiAdapter() {
        super(R.layout.huanzhe_manager_item);
    }

    @Override
    protected void convert(BaseViewHolder helper, HuanZheInfoEntity item) {
        ImageUtil.loadCircleAvatarImage((ImageView) helper.getView(R.id.avatar), item.getHeadPicture());
        helper.setText(R.id.name, item.getName());
        if ("APP".equals(item.getRegisterType() + "")) {
            ((ImageView) helper.getView(R.id.register_type)).setImageResource(R.drawable.manager_phone_icon);
        } else {
            ((ImageView) helper.getView(R.id.register_type)).setImageResource(R.drawable.manager_messgae_icon);
        }
        helper.setText(R.id.sex, item.getSex());
        helper.setText(R.id.age, item.getAge() + "岁");

        helper.setText(R.id.last_time, "上次随访:" + item.getLastVisitTime());
        helper.setText(R.id.next_time, "下次随访:" + item.getVisitTime());
    }
}
